
#pragma once

#include <AVUIDispatcherObject.h>

namespace AVUI {

class TextCompositionEventArgs : public RoutedEventArgs
{
public:
    DECLARE_ELEMENT(TextCompositionEventArgs, RoutedEventArgs);

    TextCompositionEventArgs(Key::Enum key, WCHAR wch) : m_key(key), m_wch(wch) { }

    Key::Enum get_Key() { return m_key; }
    WCHAR get_Char() { return m_wch; }

private:
    Key::Enum m_key;
    WCHAR m_wch;
};

class TextCompositionManager : public DispatcherObject
{
public:
    DECLARE_ELEMENT(TextCompositionManager, DispatcherObject);

    IMPLEMENT_ROUTED_EVENT(TextInput, TextCompositionEventArgs, RoutingStrategy::Bubble);

    bool HandleKeyChar(Key::Enum keyChar, WCHAR wch);

};

DEFINE_EVENTHANDLER(TextComposition);

};


